import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:industry_net/base/common/size_fit.dart';
import 'package:industry_net/pages/me/main/controller.dart';
import 'package:industry_net/pages/me/main/views/good_cell.dart';
import 'package:industry_net/pages/me/main/views/header.dart';

class MePage extends StatelessWidget {
  MePage({Key? key}) : super(key: key);
  final MeController controller = Get.put(MeController());
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          CustomScrollView(
            controller: controller.state.scrollController,
            slivers: <Widget>[
              buildHeader(),
              SliverPadding(
                padding: EdgeInsets.symmetric(horizontal: gap12),
                sliver: SliverGrid(
                    delegate: SliverChildBuilderDelegate((context, index) {
                      return GoodsCell(
                        index: index,
                      );
                    }),
                    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                        mainAxisSpacing: 10.w,
                        crossAxisSpacing: 10.w,
                        mainAxisExtent: 268.w,
                        crossAxisCount: 2)),
              )
            ],
          ),
          Positioned(
            height: 110.5.w,
            child: MeInfoView(),
          )
        ],
      ),
    );
  }
}
